var post_id=0,post_rating=0,is_being_rated=!1;ratingsL10n.custom=parseInt(ratingsL10n.custom);ratingsL10n.max=parseInt(ratingsL10n.max);ratingsL10n.show_loading=parseInt(ratingsL10n.show_loading);ratingsL10n.show_fading=parseInt(ratingsL10n.show_fading);
function current_rating(a,b,c){if(!is_being_rated){post_id=a;post_rating=b;if(ratingsL10n.custom&&2==ratingsL10n.max)jQuery("#rating_"+post_id+"_"+b).attr("src",eval("ratings_"+b+"_mouseover_image.src"));else for(i=1;i<=b;i++)ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",eval("ratings_"+i+"_mouseover_image.src")):jQuery("#rating_"+post_id+"_"+i).attr("src",ratings_mouseover_image.src);jQuery("#ratings_"+post_id+"_text").length&&(jQuery("#ratings_"+post_id+"_text").show(),jQuery("#ratings_"+
post_id+"_text").html(c))}}
function ratings_off(a,b,c){if(!is_being_rated){for(i=1;i<=ratingsL10n.max;i++)i<=a?ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_on."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_on."+ratingsL10n.image_ext):i==b?ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+
i+"_half"+(c?"-rtl":"")+"."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_half"+(c?"-rtl":"")+"."+ratingsL10n.image_ext):ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_off."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_off."+ratingsL10n.image_ext);jQuery("#ratings_"+
post_id+"_text").length&&(jQuery("#ratings_"+post_id+"_text").hide(),jQuery("#ratings_"+post_id+"_text").empty())}}function set_is_being_rated(a){is_being_rated=a}function rate_post_success(a){jQuery("#post-ratings-"+post_id).html(a);ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").hide();ratingsL10n.show_fading?jQuery("#post-ratings-"+post_id).fadeTo("def",1,function(){set_is_being_rated(!1)}):set_is_being_rated(!1)}
function rate_post(){post_ratings_el=jQuery("#post-ratings-"+post_id);if(is_being_rated)alert(ratingsL10n.text_wait);else{post_ratings_nonce=jQuery(post_ratings_el).data("nonce");if("undefined"==typeof post_ratings_nonce||null==post_ratings_nonce)post_ratings_nonce=jQuery(post_ratings_el).attr("data-nonce");set_is_being_rated(!0);ratingsL10n.show_fading?jQuery(post_ratings_el).fadeTo("def",0,function(){ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").show();jQuery.ajax({type:"POST",
xhrFields:{withCredentials:!0},dataType:"html",url:ratingsL10n.ajax_url,data:"action=postratings&pid="+post_id+"&rate="+post_rating+"&postratings_"+post_id+"_nonce="+post_ratings_nonce,cache:!1,success:rate_post_success})}):(ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").show(),jQuery.ajax({type:"POST",xhrFields:{withCredentials:!0},dataType:"html",url:ratingsL10n.ajax_url,data:"action=postratings&pid="+post_id+"&rate="+post_rating+"&postratings_"+post_id+"_nonce="+post_ratings_nonce,
cache:!1,success:rate_post_success}))}};
jQuery.easing['jswing']=jQuery.easing['swing'];
jQuery.extend(jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d){
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d){
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d){
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d){
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d){
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d){
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d){
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d){
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d){
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d){
if((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d){
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d){
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d){
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d){
return (t==0) ? b:c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d){
return (t==d) ? b+c:c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d){
if(t==0) return b;
if(t==d) return b+c;
if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d){
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d){
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d){
if((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3;
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
},
easeOutElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3;
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p) + c + b;
},
easeInOutElastic: function (x, t, b, c, d){
var s=1.70158;var p=0;var a=c;
if(t==0) return b; if((t/=d/2)==2) return b+c; if(!p) p=d*(.3*1.5);
if(a < Math.abs(c)){ a=c; var s=p/4; }
else var s=p/(2*Math.PI) * Math.asin (c/a);
if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p)*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s){
if(s==undefined) s=1.70158;
if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d){
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d){
if((t/=d) < (1/2.75)){
return c*(7.5625*t*t) + b;
}else if(t < (2/2.75)){
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
}else if(t < (2.5/2.75)){
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
}else{
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}},
easeInOutBounce: function (x, t, b, c, d){
if(t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}});
(function($){
$.fn.fitVids=function(options){
var settings={
customSelector: null
}
var div=document.createElement('div'),
ref=document.getElementsByTagName('base')[0]||document.getElementsByTagName('script')[0];
div.className='fit-vids-style';
div.innerHTML='';
ref.parentNode.insertBefore(div,ref);
if(options){
$.extend(settings, options);
}
return this.each(function(){
var selectors=[
"iframe[src*='player.vimeo.com']",
"iframe[src*='www.youtube.com']",
"iframe[src*='www.kickstarter.com']",
"iframe[src*='www.dailymotion.com']",
"object",
"embed"
];
if(settings.customSelector){
selectors.push(settings.customSelector);
}
var $allVideos=$(this).find(selectors.join(','));
$allVideos.each(function(){
var $this=$(this);
if(this.tagName.toLowerCase()=='embed'&&$this.parent('object').length||$this.parent('.fluid-width-video-wrapper').length){ return; }
var height=(this.tagName.toLowerCase()=='object'||$this.attr('height')) ? $this.attr('height'):$this.height(),
width=$this.attr('width') ? $this.attr('width'):$this.width(),
aspectRatio=height / width;
if(!$this.attr('id')){
var videoID='fitvid' + Math.floor(Math.random()*999999);
$this.attr('id', videoID);
}
$this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
$this.removeAttr('height').removeAttr('width');
});
});
}})(jQuery);
jQuery(document).ready(function($){
$(".post-video, .video-embed, #portfolio-video, .widget_embed").fitVids();
});
var min_w=1500;
var video_width_original=1280;
var video_height_original=720;
var vid_ratio=1280/720;
jQuery(document).ready(function($){
$('.accordion').each(function(){
var acc=$(this).attr("rel") * 2;
$(this).find('.accordion-inner:nth-child(' + acc + ')').show();
$(this).find('.accordion-inner:nth-child(' + acc + ')').prev().addClass("active");
});
$('.accordion .accordion-title').click(function(){
if($(this).next().is(':hidden')){
$(this).parent().find('.accordion-title').removeClass('active').next().slideUp(200);
$(this).toggleClass('active').next().slideDown(200);
}
return false;
});
$(".alert-message .close").click(function(){
$(this).parent().animate({'opacity':'0'}, 300).slideUp(300);
return false;
});
$('.skillbar').each(function(){
dataperc=$(this).attr('data-perc'),
$(this).find('.skill-percentage').animate({ "width":dataperc + "%"}, dataperc*20);
});
$('div.tabset').tabset();
if($(".toggle .toggle-title").hasClass('active')){
$(".toggle .toggle-title.active").closest('.toggle').find('.toggle-inner').show();
}
$(".toggle .toggle-title").click(function(){
if($(this).hasClass('active')){
$(this).removeClass("active").closest('.toggle').find('.toggle-inner').slideUp(200);
}else{
$(this).addClass("active").closest('.toggle').find('.toggle-inner').slideDown(200);
}});
vid_w_orig=parseInt($('video').attr('width'));
vid_h_orig=parseInt($('video').attr('height'));
$(window).resize(function (){ resizeToCover(); });
$(window).trigger('resize');
function resizeToCover(){
$('.videosection .video-wrap').each(function(i){
var $sectionWidth=$(this).closest('.videosection').outerWidth();
var $sectionHeight=$(this).closest('.videosection').outerHeight();
$(this).width($sectionWidth);
$(this).height($sectionHeight);
var scale_h=$sectionWidth / video_width_original;
var scale_v=$sectionHeight / video_height_original;
var scale=scale_h > scale_v ? scale_h:scale_v;
min_w=vid_ratio * ($sectionHeight+20);
if(scale * video_width_original < min_w){scale=min_w / video_width_original;}
$(this).find('video, .mejs-overlay, .mejs-poster').width(Math.ceil(scale * video_width_original +2));
$(this).find('video, .mejs-overlay, .mejs-poster').height(Math.ceil(scale * video_height_original +2));
$(this).scrollLeft(($(this).find('video').width() - $sectionWidth) / 2);
$(this).find('.mejs-overlay, .mejs-poster').scrollTop(($(this).find('video').height() - ($sectionHeight)) / 2);
$(this).scrollTop(($(this).find('video').height() - ($sectionHeight)) / 2);
});
}
});
(function ($){
$.fn.tabset=function (){
var $tabsets=$(this);
$tabsets.each(function (i){
var $tabs=$('li.tab a', this);
$tabs.click(function (e){
var $this=$(this);
panels=$.map($tabs, function (val, i){
return $(val).attr('href');
});
$(panels.join(',')).hide();
$tabs.removeClass('selected');
$this.addClass('selected').blur();
$($this.attr('href')).show();
e.preventDefault();
return false;
}).first().triggerHandler('click');
});
};})(jQuery);
!function ($){
"use strict";
var Tooltip=function (element, options){
this.init('tooltip', element, options)
}
Tooltip.prototype={
constructor: Tooltip
, init: function (type, element, options){
var eventIn
, eventOut
this.type=type
this.$element=$(element)
this.options=this.getOptions(options)
this.enabled=true
if(this.options.trigger=='click'){
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
}else if(this.options.trigger!='manual'){
eventIn=this.options.trigger=='hover' ? 'mouseenter':'focus'
eventOut=this.options.trigger=='hover' ? 'mouseleave':'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
this.options.selector ?
(this._options=$.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
, getOptions: function (options){
options=$.extend({}, $.fn[this.type].defaults, options, this.$element.data())
if(options.delay&&typeof options.delay=='number'){
options.delay={
show: options.delay
, hide: options.delay
}}
return options
}
, enter: function (e){
var self=$(e.currentTarget)[this.type](this._options).data(this.type)
clearTimeout(this.removeTimeout)
if(!self.options.delay||!self.options.delay.show) return self.show()
clearTimeout(this.timeout)
self.hoverState='in'
this.timeout=setTimeout(function(){
if(self.hoverState=='in') self.show()
}, self.options.delay.show)
}
, leave: function (e){
var self=$(e.currentTarget)[this.type](this._options).data(this.type)
if(this.timeout) clearTimeout(this.timeout)
if(!self.options.delay||!self.options.delay.hide) return self.hide()
self.hoverState='out'
this.timeout=setTimeout(function(){
if(self.hoverState=='out') self.hide()
}, self.options.delay.hide)
}
, show: function (){
var $tip
, inside
, pos
, actualWidth
, actualHeight
, placement
, tp
if(this.hasContent()&&this.enabled){
$tip=this.tip()
this.setContent()
if(this.options.animation){
$tip.addClass('fade')
}
placement=typeof this.options.placement=='function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
inside=/in/.test(placement)
$tip
.remove()
.css({ top: 0, left: 0, display: 'block' })
.appendTo(inside ? this.$element:document.body)
pos=this.getPosition(inside)
actualWidth=$tip[0].offsetWidth
actualHeight=$tip[0].offsetHeight
switch (inside ? placement.split(' ')[1]:placement){
case 'bottom':
tp={top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
break
case 'top':
tp={top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
break
case 'left':
tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
break
case 'right':
tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
break
}
$tip
.css(tp)
.addClass(placement)
.addClass('in')
}}
, setContent: function (){
var $tip=this.tip()
, title=this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html':'text'](title)
$tip.removeClass('fade in top bottom left right')
}
, hide: function (){
var that=this
, $tip=this.tip()
$tip.removeClass('in')
function removeWithAnimation(){
that.removeTimeout=setTimeout(function (){
$tip.off($.support.transition.end).remove()
}, 500)
$tip.one($.support.transition.end, function (){
clearTimeout(that.removeTimeout)
$tip.remove()
})
}
$.support.transition&&this.$tip.hasClass('fade') ?
removeWithAnimation() :
$tip.remove()
return this
}
, fixTitle: function (){
var $e=this.$element
if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){
$e.attr('data-original-title', $e.attr('title')||'').removeAttr('title')
}}
, hasContent: function (){
return this.getTitle()
}
, getPosition: function (inside){
return $.extend({}, (inside ? {top: 0, left: 0}:this.$element.offset()), {
width: this.$element[0].offsetWidth
, height: this.$element[0].offsetHeight
})
}
, getTitle: function (){
var title
, $e=this.$element
, o=this.options
title=$e.attr('data-original-title')
|| (typeof o.title=='function' ? o.title.call($e[0]):o.title)
return title
}
, tip: function (){
return this.$tip=this.$tip||$(this.options.template)
}
, validate: function (){
if(!this.$element[0].parentNode){
this.hide()
this.$element=null
this.options=null
}}
, enable: function (){
this.enabled=true
}
, disable: function (){
this.enabled=false
}
, toggleEnabled: function (){
this.enabled = !this.enabled
}
, toggle: function (){
this[this.tip().hasClass('in') ? 'hide':'show']()
}
, destroy: function (){
this.hide().$element.off('.' + this.type).removeData(this.type)
}}
$.fn.tooltip=function(option){
return this.each(function (){
var $this=$(this)
, data=$this.data('tooltip')
, options=typeof option=='object'&&option
if(!data) $this.data('tooltip', (data=new Tooltip(this, options)))
if(typeof option=='string') data[option]()
})
}
$.fn.tooltip.Constructor=Tooltip
$.fn.tooltip.defaults={
animation: true
, placement: 'top'
, selector: false
, template: ''
, trigger: 'hover'
, title: ''
, delay: 0
, html: true
}}(window.jQuery);
jQuery(document).ready(function($){
$('.meta-category a, .meta-author a').tooltip({placement: 'top'});
$('.tooltips').tooltip({ selector: "a[rel=tooltip]" });
$('#topbar .social-icons a').tooltip({placement: 'bottom', animation: true});
$('.sharebox .social-icons a').tooltip({placement: 'top'});
$('.member-social a').tooltip({placement: 'top'});
$('#copyright .social-icons a').tooltip({placement: 'top'});
$('.social-icon a').tooltip({placement: 'top'});
$('.portfolio-widget-item a').tooltip({placement: 'bottom'});
$('#header-cart').tooltip({placement: 'top'});
});
(function ($){
"use strict";
var methods=(function (){
var c={
bcClass: 'sf-breadcrumb',
menuClass: 'sf-js-enabled',
anchorClass: 'sf-with-ul',
menuArrowClass: 'sf-arrows'
},
ios=(function (){
var ios=/iPhone|iPad|iPod/i.test(navigator.userAgent);
if(ios){
$(window).load(function (){
$('body').children().on('click', $.noop);
});
}
return ios;
})(),
wp7=(function (){
var style=document.documentElement.style;
return ('behavior' in style&&'fill' in style&&/iemobile/i.test(navigator.userAgent));
})(),
toggleMenuClasses=function ($menu, o){
var classes=c.menuClass;
if(o.cssArrows){
classes +=' ' + c.menuArrowClass;
}
$menu.toggleClass(classes);
},
setPathToCurrent=function ($menu, o){
return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
.addClass(o.hoverClass + ' ' + c.bcClass)
.filter(function (){
return ($(this).children(o.popUpSelector).hide().show().length);
}).removeClass(o.pathClass);
},
toggleAnchorClass=function ($li){
$li.children('a').toggleClass(c.anchorClass);
},
toggleTouchAction=function ($menu){
var touchAction=$menu.css('ms-touch-action');
touchAction=(touchAction==='pan-y') ? 'auto':'pan-y';
$menu.css('ms-touch-action', touchAction);
},
applyHandlers=function ($menu, o){
var targets='li:has(' + o.popUpSelector + ')';
if($.fn.hoverIntent&&!o.disableHI){
$menu.hoverIntent(over, out, targets);
}else{
$menu
.on('mouseenter.superfish', targets, over)
.on('mouseleave.superfish', targets, out);
}
var touchevent='MSPointerDown.superfish';
if(!ios){
touchevent +=' touchend.superfish';
}
if(wp7){
touchevent +=' mousedown.superfish';
}
$menu
.on('focusin.superfish', 'li', over)
.on('focusout.superfish', 'li', out)
.on(touchevent, 'a', o, touchHandler);
},
touchHandler=function (e){
var $this=$(this),
$ul=$this.siblings(e.data.popUpSelector);
if($ul.length > 0&&$ul.is(':hidden')){
$this.one('click.superfish', false);
if(e.type==='MSPointerDown'){
$this.trigger('focus');
}else{
$.proxy(over, $this.parent('li'))();
}}
},
over=function (){
var $this=$(this),
o=getOptions($this);
clearTimeout(o.sfTimer);
$this.siblings().superfish('hide').end().superfish('show');
},
out=function (){
var $this=$(this),
o=getOptions($this);
if(ios){
$.proxy(close, $this, o)();
}else{
clearTimeout(o.sfTimer);
o.sfTimer=setTimeout($.proxy(close, $this, o), o.delay);
}},
close=function (o){
o.retainPath=($.inArray(this[0], o.$path) > -1);
this.superfish('hide');
if(!this.parents('.' + o.hoverClass).length){
o.onIdle.call(getMenu(this));
if(o.$path.length){
$.proxy(over, o.$path)();
}}
},
getMenu=function ($el){
return $el.closest('.' + c.menuClass);
},
getOptions=function ($el){
return getMenu($el).data('sf-options');
};
return {
hide: function (instant){
if(this.length){
var $this=this,
o=getOptions($this);
if(!o){
return this;
}
var not=(o.retainPath===true) ? o.$path:'',
$ul=$this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
speed=o.speedOut;
if(instant){
$ul.show();
speed=0;
}
o.retainPath=false;
o.onBeforeHide.call($ul);
$ul.stop(true, true).animate(o.animationOut, speed, function (){
var $this=$(this);
o.onHide.call($this);
});
}
return this;
},
show: function (){
var o=getOptions(this);
if(!o){
return this;
}
var $this=this.addClass(o.hoverClass),
$ul=$this.children(o.popUpSelector);
o.onBeforeShow.call($ul);
$ul.stop(true, true).animate(o.animation, o.speed, function (){
o.onShow.call($ul);
});
return this;
},
destroy: function (){
return this.each(function (){
var $this=$(this),
o=$this.data('sf-options'),
$hasPopUp;
if(!o){
return false;
}
$hasPopUp=$this.find(o.popUpSelector).parent('li');
clearTimeout(o.sfTimer);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
$this.off('.superfish').off('.hoverIntent');
$hasPopUp.children(o.popUpSelector).attr('style', function (i, style){
return style.replace(/display[^;]+;?/g, '');
});
o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
$this.find('.' + o.hoverClass).removeClass(o.hoverClass);
o.onDestroy.call($this);
$this.removeData('sf-options');
});
},
init: function (op){
return this.each(function (){
var $this=$(this);
if($this.data('sf-options')){
return false;
}
var o=$.extend({}, $.fn.superfish.defaults, op),
$hasPopUp=$this.find(o.popUpSelector).parent('li');
o.$path=setPathToCurrent($this, o);
$this.data('sf-options', o);
toggleMenuClasses($this, o);
toggleAnchorClass($hasPopUp);
toggleTouchAction($this);
applyHandlers($this, o);
$hasPopUp.not('.' + c.bcClass).superfish('hide', true);
o.onInit.call(this);
});
}};})();
$.fn.superfish=function (method, args){
if(methods[method]){
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
}
else if(typeof method==='object'||! method){
return methods.init.apply(this, arguments);
}else{
return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish');
}};
$.fn.superfish.defaults={
popUpSelector: 'ul,.sf-mega',
hoverClass: 'sfHover',
pathClass: 'overrideThisToUse',
pathLevels: 1,
delay: 800,
animation: {opacity: 'show'},
animationOut: {opacity: 'hide'},
speed: 'normal',
speedOut: 'fast',
cssArrows: true,
disableHI: false,
onInit: $.noop,
onBeforeShow: $.noop,
onShow: $.noop,
onBeforeHide: $.noop,
onHide: $.noop,
onIdle: $.noop,
onDestroy: $.noop
};
$.fn.extend({
hideSuperfishUl: methods.hide,
showSuperfishUl: methods.show
});
})(jQuery);
(function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:6,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn)}else{if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector})}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut})}}var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.sqrt((pX-cX)*(pX-cX)+(pY-cY)*(pY-cY))',{
'class':settings.className
}).insertAfter(el);
$('', {
"value":'#',
"text":settings.defaultText
}).appendTo('.' + settings.className);
el.find('a').each(function(){
var $this=$(this),
optText=' ' + $this.text(),
optSub=$this.parents('.' + settings.subMenuClass),
len=optSub.length,
dash;
if($this.parents('ul').hasClass(settings.subMenuClass)){
dash=Array(len+1).join(settings.subMenuDash);
optText=dash + optText;
}
$('', {
"value":this.href,
"html":optText,
"selected":(this.href==window.location.href)
}).appendTo('.' + settings.className);
});
$('.' + settings.className).change(function(){
var locations=$(this).val();
if(locations!=='#'){
window.location.href=$(this).val();
};});
});
return this;
};})(jQuery);
jQuery(document).ready(function($){
$('#navigation ul.menu').mobileMenu({
defaultText: 'Navigation',
className: 'select-menu',
subMenuDash: '–'
});
});
(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this);
(function(){
(function(root, factory){
if(typeof define==='function'&&define.amd){
return define(['jquery', 'waypoints'], factory);
}else{
return factory(root.jQuery);
}})(this, function($){
var defaults, wrap;
defaults={
wrapper: '',
stuckClass: 'stuck'
};
wrap=function($elements, options){
$elements.wrap(options.wrapper);
$elements.each(function(){
var $this;
$this=$(this);
$this.parent().height($this.outerHeight());
return true;
});
return $elements.parent();
};
return $.waypoints('extendFn', 'sticky', function(options){
var $wrap, originalHandler;
options=$.extend({}, $.fn.waypoint.defaults, defaults, options);
$wrap=wrap(this, options);
originalHandler=options.handler;
options.handler=function(direction){
var $sticky, shouldBeStuck;
$sticky=$(this).children(':first');
shouldBeStuck=direction==='down'||direction==='right';
$sticky.toggleClass(options.stuckClass, shouldBeStuck);
if(originalHandler!=null){
return originalHandler.call(this, direction);
}};
$wrap.waypoint(options);
return this;
});
});
}).call(this);
jQuery(document).ready(function($){
$('input[type=text]').each(function(){
var default_value=this.value;
$(this).focus(function(){
if(this.value==default_value){
this.value='';
}});
$(this).blur(function(){
if(this.value==''){
this.value=default_value;
}});
});
$(".post-image a, .post-gallery a, #portfolio-slider li a").hover(function(){
$(this).has('img').append('');
$(this).find('.overlay').animate({opacity:'1'}, 300);
}, function(){
$(this).find('.overlay').animate({opacity:'0'}, 300 ,function(){
$(this).remove();
});
});
$('.portfolio-item').hover(function(){
$(this).find('.portfolio-overlay').stop().animate({'opacity':1}, 200, 'easeOutSine');
$(this).find('.overlay-link, .overlay-lightbox').stop().animate({'top':$(this).height()/2-54, 'opacity':1}, 160, 'easeOutSine');
}, function(){
$(this).find('.portfolio-overlay').stop().animate({'opacity':0}, 300, 'easeInSine');
$(this).find('.overlay-link, .overlay-lightbox').stop().animate({'top':-25, 'opacity':0}, 260, 'easeOutSine');
});
$('.portfolio-item-one .portfolio-picwrap').hover(function(){
$(this).find('.portfolio-overlay').stop().animate({'opacity':1}, 200, 'easeOutSine');
$(this).find('.overlay-link, .overlay-lightbox').stop().animate({'top':$(this).height()/2-24, 'opacity':1}, 160, 'easeOutSine');
}, function(){
$(this).find('.portfolio-overlay').stop().animate({'opacity':0}, 300, 'easeInSine');
$(this).find('.overlay-link, .overlay-lightbox').stop().animate({'top':-25, 'opacity':0}, 260, 'easeOutSine');
});
$('.blog-item').hover(function(){
$(this).find('.blog-overlay').stop().animate({'opacity':1}, 200, 'easeOutSine');
$(this).find('.post-icon').stop().animate({'top':50, 'opacity':1}, 160, 'easeOutSine');
}, function(){
$(this).find('.blog-overlay').stop().animate({'opacity':0}, 300, 'easeInSine');
$(this).find('.post-icon').stop().animate({'top':-25, 'opacity':0}, 260, 'easeOutSine');
});
$(window).scroll(function(){
if($(window).scrollTop() > 200){
$("#back-to-top").fadeIn(200);
}else{
$("#back-to-top").fadeOut(200);
}});
$('#back-to-top, .back-to-top').click(function(){
$('html, body').animate({ scrollTop:0 }, '800');
return false;
});
var infostate='close';
var infobarheight=$('#infobar').height() + 62;
$('.close-infobar').click(function(){
if(infostate=='close'){
$('#infobar').show().animate({ top:0 }, 220, 'easeOutQuad');
$(this).addClass('open');
infostate='open';
}
else if(infostate=='open'){
$('#infobar').show().animate({ top:-infobarheight }, 220, 'easeOutQuad');
$(this).removeClass('open');
infostate='close';
}
return false;
});
$('#infobar').css({'top':-infobarheight}).fadeIn('fast');
$(window).resize(function(){
infobarheight=$('#infobar').height() + 62;
$('#infobar').css({'top':-infobarheight}).show();
$('.close-infobar').removeClass('open');
infostate='close';
});
});
!function(e){function t(){var e=location.href;return hashtag=-1!==e.indexOf("#prettyPhoto")?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):!1,hashtag&&(hashtag=hashtag.replace(/<|>/g,"")),hashtag}function i(){"undefined"!=typeof theRel&&(location.hash=theRel+"/"+rel_index+"/")}function p(){-1!==location.href.indexOf("#prettyPhoto")&&(location.hash="prettyPhoto")}function o(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+e+"=([^]*)",p=new RegExp(i),o=p.exec(t);return null==o?"":o[1]}e.prettyPhoto={version:"3.1.6"},e.fn.prettyPhoto=function(a){function s(){e(".pp_loaderIcon").hide(),projectedTop=scroll_pos.scrollTop+(I/2-f.containerHeight/2),projectedTop<0&&(projectedTop=0),$ppt.fadeTo(settings.animation_speed,1),$pp_pic_holder.find(".pp_content").animate({height:f.contentHeight,width:f.contentWidth},settings.animation_speed),$pp_pic_holder.animate({top:projectedTop,left:j/2-f.containerWidth/2<0?0:j/2-f.containerWidth/2,width:f.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(f.height).width(f.width),$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed),isSet&&"image"==h(pp_images[set_position])?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide(),settings.allow_expand&&(f.resized?e("a.pp_expand,a.pp_contract").show():e("a.pp_expand").hide()),!settings.autoplay_slideshow||P||v||e.prettyPhoto.startSlideshow(),settings.changepicturecallback(),v=!0}),m(),a.ajaxcallback()}function n(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden"),$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show(),t()})}function r(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function l(e,t){if(resized=!1,d(e,t),imageWidth=e,imageHeight=t,(k>j||b>I)&&doresize&&settings.allow_resize&&!$){for(resized=!0,fitting=!1;!fitting;)k>j?(imageWidth=j-200,imageHeight=t/e*imageWidth):b>I?(imageHeight=I-200,imageWidth=e/t*imageHeight):fitting=!0,b=imageHeight,k=imageWidth;(k>j||b>I)&&l(k,b),d(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(b),containerWidth:Math.floor(k)+2*settings.horizontal_padding,contentHeight:Math.floor(y),contentWidth:Math.floor(w),resized:resized}}function d(t,i){t=parseFloat(t),i=parseFloat(i),$pp_details=$pp_pic_holder.find(".pp_details"),$pp_details.width(t),detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom")),$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4}),detailsHeight+=$pp_details.height(),detailsHeight=detailsHeight<=34?36:detailsHeight,$pp_details.remove(),$pp_title=$pp_pic_holder.find(".ppt"),$pp_title.width(t),titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom")),$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4}),titleHeight+=$pp_title.height(),$pp_title.remove(),y=i+detailsHeight,w=t,b=y+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height(),k=t}function h(e){return e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)?"youtube":e.match(/vimeo\.com/i)?"vimeo":e.match(/\b.mov\b/i)?"quicktime":e.match(/\b.swf\b/i)?"flash":e.match(/\biframe=true\b/i)?"iframe":e.match(/\bajax=true\b/i)?"ajax":e.match(/\bcustom=true\b/i)?"custom":"#"==e.substr(0,1)?"inline":"image"}function c(){if(doresize&&"undefined"!=typeof $pp_pic_holder){if(scroll_pos=_(),contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width(),projectedTop=I/2+scroll_pos.scrollTop-contentHeight/2,projectedTop<0&&(projectedTop=0),contentHeight>I)return;$pp_pic_holder.css({top:projectedTop,left:j/2+scroll_pos.scrollLeft-contentwidth/2})}}function _(){return self.pageYOffset?{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}:document.documentElement&&document.documentElement.scrollTop?{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}:document.body?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:void 0}function g(){I=e(window).height(),j=e(window).width(),"undefined"!=typeof $pp_overlay&&$pp_overlay.height(e(document).height()).width(j)}function m(){isSet&&settings.overlay_gallery&&"image"==h(pp_images[set_position])?(itemWidth=57,navWidth="facebook"==settings.theme||"pp_default"==settings.theme?50:30,itemsPerPage=Math.floor((f.containerWidth-100-navWidth)/itemWidth),itemsPerPage=itemsPerPage
";toInject=settings.gallery_markup.replace(/{gallery}/g,toInject),$pp_pic_holder.find("#pp_full_res").after(toInject),$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li"),$pp_gallery.find(".pp_arrow_next").click(function(){return e.prettyPhoto.changeGalleryPage("next"),e.prettyPhoto.stopSlideshow(),!1}),$pp_gallery.find(".pp_arrow_previous").click(function(){return e.prettyPhoto.changeGalleryPage("previous"),e.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()}),itemWidth=57,$pp_gallery_li.each(function(t){e(this).find("a").click(function(){return e.prettyPhoto.changePage(t),e.prettyPhoto.stopSlideshow(),!1})})}settings.slideshow&&($pp_pic_holder.find(".pp_nav").prepend('Play'),$pp_pic_holder.find(".pp_nav .pp_play").click(function(){return e.prettyPhoto.startSlideshow(),!1})),$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme),$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){settings.modal||e.prettyPhoto.close()}),e("a.pp_close").bind("click",function(){return e.prettyPhoto.close(),!1}),settings.allow_expand&&e("a.pp_expand").bind("click",function(){return e(this).hasClass("pp_expand")?(e(this).removeClass("pp_expand").addClass("pp_contract"),doresize=!1):(e(this).removeClass("pp_contract").addClass("pp_expand"),doresize=!0),n(function(){e.prettyPhoto.open()}),!1}),$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){return e.prettyPhoto.changePage("previous"),e.prettyPhoto.stopSlideshow(),!1}),$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){return e.prettyPhoto.changePage("next"),e.prettyPhoto.stopSlideshow(),!1}),c()}a=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:!1,opacity:.8,show_title:!0,allow_resize:!0,allow_expand:!0,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:!1,wmode:"opaque",autoplay:!0,modal:!1,deeplinking:!0,overlay_gallery:!0,overlay_gallery_max:30,keyboard_shortcuts:!0,changepicturecallback:function(){},callback:function(){},ie6_fallback:!0,markup:' ',gallery_markup:'',image_markup:'
',flash_markup:'',quicktime_markup:'',iframe_markup:'',inline_markup:'{content}
',custom_markup:"",social_tools:''},a);var f,v,y,w,b,k,P,x=this,$=!1,I=e(window).height(),j=e(window).width();return doresize=!0,scroll_pos=_(),e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){c(),g()}),a.keyboard_shortcuts&&e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if("undefined"!=typeof $pp_pic_holder&&$pp_pic_holder.is(":visible"))switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous"),t.preventDefault();break;case 39:e.prettyPhoto.changePage("next"),t.preventDefault();break;case 27:settings.modal||e.prettyPhoto.close(),t.preventDefault()}}),e.prettyPhoto.initialize=function(){return settings=a,"pp_default"==settings.theme&&(settings.horizontal_padding=16),theRel=e(this).attr(settings.hook),galleryRegExp=/\[(?:.*)\]/,isSet=galleryRegExp.exec(theRel)?!0:!1,pp_images=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).attr("href"):void 0}):e.makeArray(e(this).attr("href")),pp_titles=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):"":void 0}):e.makeArray(e(this).find("img").attr("alt")),pp_descriptions=isSet?jQuery.map(x,function(t){return-1!=e(t).attr(settings.hook).indexOf(theRel)?e(t).attr("title")?e(t).attr("title"):"":void 0}):e.makeArray(e(this).attr("title")),pp_images.length>settings.overlay_gallery_max&&(settings.overlay_gallery=!1),set_position=jQuery.inArray(e(this).attr("href"),pp_images),rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this)),u(this),settings.allow_resize&&e(window).bind("scroll.prettyphoto",function(){c()}),e.prettyPhoto.open(),!1},e.prettyPhoto.open=function(t){return"undefined"==typeof settings&&(settings=a,pp_images=e.makeArray(arguments[0]),pp_titles=e.makeArray(arguments[1]?arguments[1]:""),pp_descriptions=e.makeArray(arguments[2]?arguments[2]:""),isSet=pp_images.length>1?!0:!1,set_position=arguments[3]?arguments[3]:0,u(t.target)),settings.hideflash&&e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden"),r(e(pp_images).size()),e(".pp_loaderIcon").show(),settings.deeplinking&&i(),settings.social_tools&&(facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href)),$pp_pic_holder.find(".pp_social").html(facebook_like_link)),$ppt.is(":hidden")&&$ppt.css("opacity",0).show(),$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity),$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size()),"undefined"!=typeof pp_descriptions[set_position]&&""!=pp_descriptions[set_position]?$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position])):$pp_pic_holder.find(".pp_description").hide(),movie_width=parseFloat(o("width",pp_images[set_position]))?o("width",pp_images[set_position]):settings.default_width.toString(),movie_height=parseFloat(o("height",pp_images[set_position]))?o("height",pp_images[set_position]):settings.default_height.toString(),$=!1,-1!=movie_height.indexOf("%")&&(movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150),$=!0),-1!=movie_width.indexOf("%")&&(movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150),$=!0),$pp_pic_holder.fadeIn(function(){switch($ppt.html(settings.show_title&&""!=pp_titles[set_position]&&"undefined"!=typeof pp_titles[set_position]?unescape(pp_titles[set_position]):" "),imgPreloader="",skipInjection=!1,h(pp_images[set_position])){case"image":imgPreloader=new Image,nextImage=new Image,isSet&&set_position0&&(movie_id=movie_id.substr(0,movie_id.indexOf("?"))),movie_id.indexOf("&")>0&&(movie_id=movie_id.substr(0,movie_id.indexOf("&")))),movie="http://www.youtube.com/embed/"+movie_id,movie+=o("rel",pp_images[set_position])?"?rel="+o("rel",pp_images[set_position]):"?rel=1",settings.autoplay&&(movie+="&autoplay=1"),toInject=settings.iframe_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":f=l(movie_width,movie_height),movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/,i=movie_id.match(t);movie="http://player.vimeo.com/video/"+i[3]+"?title=0&byline=0&portrait=0",settings.autoplay&&(movie+="&autoplay=1;"),vimeo_width=f.width+"/embed/?moog_width="+f.width,toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,f.height).replace(/{path}/g,movie);break;case"quicktime":f=l(movie_width,movie_height),f.height+=15,f.contentHeight+=15,f.containerHeight+=15,toInject=settings.quicktime_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":f=l(movie_width,movie_height),flash_vars=pp_images[set_position],flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length),filename=pp_images[set_position],filename=filename.substring(0,filename.indexOf("?")),toInject=settings.flash_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":f=l(movie_width,movie_height),frame_url=pp_images[set_position],frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1),toInject=settings.iframe_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{path}/g,frame_url);break;case"ajax":doresize=!1,f=l(movie_width,movie_height),doresize=!0,skipInjection=!0,e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e),$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,s()});break;case"custom":f=l(movie_width,movie_height),toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('
').css({width:settings.default_width}).wrapInner('').appendTo(e("body")).show(),doresize=!1,f=l(e(myClone).width(),e(myClone).height()),doresize=!0,e(myClone).remove(),toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html())}imgPreloader||skipInjection||($pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject,s())}),!1},e.prettyPhoto.changePage=function(t){currentGalleryPage=0,"previous"==t?(set_position--,set_position<0&&(set_position=e(pp_images).size()-1)):"next"==t?(set_position++,set_position>e(pp_images).size()-1&&(set_position=0)):set_position=t,rel_index=set_position,doresize||(doresize=!0),settings.allow_expand&&e(".pp_contract").removeClass("pp_contract").addClass("pp_expand"),n(function(){e.prettyPhoto.open()})},e.prettyPhoto.changeGalleryPage=function(e){"next"==e?(currentGalleryPage++,currentGalleryPage>totalPage&&(currentGalleryPage=0)):"previous"==e?(currentGalleryPage--,currentGalleryPage<0&&(currentGalleryPage=totalPage)):currentGalleryPage=e,slide_speed="next"==e||"previous"==e?settings.animation_speed:0,slide_to=currentGalleryPage*itemsPerPage*itemWidth,$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)},e.prettyPhoto.startSlideshow=function(){"undefined"==typeof P?($pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){return e.prettyPhoto.stopSlideshow(),!1}),P=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)):e.prettyPhoto.changePage("next")},e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){return e.prettyPhoto.startSlideshow(),!1}),clearInterval(P),P=void 0},e.prettyPhoto.close=function(){$pp_overlay.is(":animated")||(e.prettyPhoto.stopSlideshow(),$pp_pic_holder.stop().find("object,embed").css("visibility","hidden"),e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()}),$pp_overlay.fadeOut(settings.animation_speed,function(){settings.hideflash&&e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible"),e(this).remove(),e(window).unbind("scroll.prettyphoto"),p(),settings.callback(),doresize=!0,v=!1,delete settings}))},!pp_alreadyInitialized&&t()&&(pp_alreadyInitialized=!0,hashIndex=t(),hashRel=hashIndex,hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1),hashRel=hashRel.substring(0,hashRel.indexOf("/")),setTimeout(function(){e("a["+a.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)),this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)}}(jQuery);var pp_alreadyInitialized=!1;
(function (factory){
if(typeof define==='function'&&define.amd)
define(['jquery'], factory);
else
factory(jQuery);
}(function ($){
$.fn.tweet=function(o){
var s=$.extend({
modpath: "/framework/js/twitter/index.php",
username: null,
list_id: null,
list: null,
favorites: false,
query: null,
avatar_size: null,
count: 3,
fetch: null,
page: 1,
retweets: true,
intro_text: null,
outro_text: null,
join_text: null,
auto_join_text_default: "i said,",
auto_join_text_ed: "i",
auto_join_text_ing: "i am",
auto_join_text_reply: "i replied to",
auto_join_text_url: "i was looking at",
loading_text: null,
refresh_interval: null ,
twitter_url: "twitter.com",
twitter_api_url: "api.twitter.com",
twitter_search_url: "twitter.com",
template: "{avatar}{time}{join}{text}",
comparator: function(tweet1, tweet2){
return tweet2["tweet_time"] - tweet1["tweet_time"];
},
filter: function(tweet){
return true;
}}, o);
var url_regexp=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi;
function t(template, info){
if(typeof template==="string"){
var result=template;
for(var key in info){
var val=info[key];
result=result.replace(new RegExp('{'+key+'}','g'), val===null ? '':val);
}
return result;
} else return template(info);
}
$.extend({tweet: {t: t}});
function replacer (regex, replacement){
return function(){
var returning=[];
this.each(function(){
returning.push(this.replace(regex, replacement));
});
return $(returning);
};}
function escapeHTML(s){
return s.replace(//g,"^>");
}
$.fn.extend({
linkUser: replacer(/(^|[\W])@(\w+)/gi, "$1@$2"),
linkHash: replacer(/(?:^|)[\#]+([\w\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0600-\u06ff]+)/gi,
' '),
makeHeart: replacer(/(<)+[3]/gi, "♥")
});
function linkURLs(text, entities){
return text.replace(url_regexp, function(match){
var url=(/^[a-z]+:/i).test(match) ? match:"http://"+match;
var text=match;
for(var i=0; i < entities.length; ++i){
var entity=entities[i];
if(entity.url==url&&entity.expanded_url){
url=entity.expanded_url;
text=entity.display_url;
break;
}}
return ""+escapeHTML(text)+"";
});
}
function parse_date(date_str){
return Date.parse(date_str.replace(/^([a-z]{3})([a-z]{3} \d\d?)(.*)(\d{4})$/i, '$1,$2$4$3'));
}
function relative_time(date){
var relative_to=(arguments.length > 1) ? arguments[1]:new Date();
var delta=parseInt((relative_to.getTime() - date) / 1000, 10);
var r='';
if(delta < 1){
r='just now';
}else if(delta < 60){
r=delta + ' seconds ago';
}else if(delta < 120){
r='about a minute ago';
}else if(delta < (45*60)){
r='about ' + (parseInt(delta / 60, 10)).toString() + ' minutes ago';
}else if(delta < (2*60*60)){
r='about an hour ago';
}else if(delta < (24*60*60)){
r='about ' + (parseInt(delta / 3600, 10)).toString() + ' hours ago';
}else if(delta < (48*60*60)){
r='about a day ago';
}else{
r='about ' + (parseInt(delta / 86400, 10)).toString() + ' days ago';
}
return r;
}
function build_auto_join_text(text){
if(text.match(/^(@([A-Za-z0-9-_]+)) .*/i)){
return s.auto_join_text_reply;
}else if(text.match(url_regexp)){
return s.auto_join_text_url;
}else if(text.match(/^((\w+ed)|just) .*/im)){
return s.auto_join_text_ed;
}else if(text.match(/^(\w*ing) .*/i)){
return s.auto_join_text_ing;
}else{
return s.auto_join_text_default;
}}
function build_api_request(){
var modpath=s.modpath,
count=(s.fetch===null) ? s.count:s.fetch,
defaults={
include_entities: 1
};
if(s.list){
return {
host: s.twitter_api_url,
url: "/1.1/lists/statuses.json",
parameters: $.extend({}, defaults, {
list_id: s.list_id,
slug: s.list,
owner_screen_name: s.username,
page: s.page,
count: count,
include_rts: (s.retweets ? 1:0)
})
};}else if(s.favorites){
return {
host: s.twitter_api_url,
url: "/1.1/favorites/list.json",
parameters: $.extend({}, defaults, {
list_id: s.list_id,
screen_name: s.username,
page: s.page,
count: count
})
};}else if(s.query===null&&s.username.length===1){
return {
host: s.twitter_api_url,
url: "/1.1/statuses/user_timeline.json",
parameters: $.extend({}, defaults, {
screen_name: s.username,
page: s.page,
count: count,
include_rts: (s.retweets ? 1:0)
})
};}else{
var query=(s.query||'from:'+s.username.join(' OR from:'));
return {
host: s.twitter_search_url,
url: "/search.json",
parameters: $.extend({}, defaults, {
page: s.page,
q: query,
rpp: count
})
};}}
function extract_avatar_url(item, secure){
if(secure){
return ('user' in item) ?
item.user.profile_image_url_https :
extract_avatar_url(item, false).
replace(/^http:\/\/[a-z0-9]{1,3}\.twimg\.com\//, "https://s3.amazonaws.com/twitter_production/");
}else{
return item.profile_image_url||item.user.profile_image_url;
}}
function extract_template_data(item){
var o={};
o.item=item;
o.source=item.source;
o.name=item.from_user_name||item.user.name;
o.screen_name=item.from_user||item.user.screen_name;
o.avatar_size=s.avatar_size;
o.avatar_url=extract_avatar_url(item, (document.location.protocol==='https:'));
o.retweet=typeof(item.retweeted_status)!='undefined';
o.tweet_time=parse_date(item.created_at);
o.join_text=s.join_text=="auto" ? build_auto_join_text(item.text):s.join_text;
o.tweet_id=item.id_str;
o.twitter_base="http://"+s.twitter_url+"/";
o.user_url=o.twitter_base+o.screen_name;
o.tweet_url=o.user_url+"/status/"+o.tweet_id;
o.reply_url=o.twitter_base+"intent/tweet?in_reply_to="+o.tweet_id;
o.retweet_url=o.twitter_base+"intent/retweet?tweet_id="+o.tweet_id;
o.favorite_url=o.twitter_base+"intent/favorite?tweet_id="+o.tweet_id;
o.retweeted_screen_name=o.retweet&&item.retweeted_status.user.screen_name;
o.tweet_relative_time=relative_time(o.tweet_time);
o.entities=item.entities ? (item.entities.urls||[]).concat(item.entities.media||[]):[];
o.tweet_raw_text=o.retweet ? ('RT @'+o.retweeted_screen_name+' '+item.retweeted_status.text):item.text;
o.tweet_text=$([linkURLs(o.tweet_raw_text, o.entities)]).linkUser().linkHash()[0];
o.tweet_text_fancy=$([o.tweet_text]).makeHeart()[0];
o.user=t('', o);
o.join=s.join_text ? t(' ', o):' ';
o.avatar=o.avatar_size ?
t('', o):'';
o.time=t('', o);
o.text=t('', o);
o.reply_action=t('', o);
o.retweet_action=t('', o);
o.favorite_action=t('', o);
return o;
}
return this.each(function(i, widget){
var list=$('